﻿using System.Collections.Generic;
using Co9320.NamaAlert.Model.TagServer;

namespace Co9320.NamaAlert.CommunicationControl
{
	internal class ParametersCollection
	{
		private List<AddDeleteParamerter> AddList_;
		private List<AddDeleteParamerter> DeleteList_;
		private List<ModifyParameter> ModifyList_;

		public ParametersCollection()
		{
			AddList_ = new List<AddDeleteParamerter>();
			DeleteList_ = new List<AddDeleteParamerter>();
			ModifyList_ = new List<ModifyParameter>();
		}

		public AddDeleteParamerter[] GetAddParameters()
		{
			if (AddList_.Count == 0)
			{
				return null;
			}
			else
			{
				return AddList_.ToArray();
			}
		}

		public AddDeleteParamerter[] GetDeleteParameters()
		{
			if (DeleteList_.Count == 0)
			{
				return null;
			}
			else
			{
				return DeleteList_.ToArray();
			}
		}

		public ModifyParameter[] GetModifyParameters()
		{
			if (ModifyList_.Count == 0)
			{
				return null;
			}
			else
			{
				return ModifyList_.ToArray();
			}
		}

		public void RegistAddParameter(AddDeleteParamerter Parameter)
		{
			if (Parameter == null)
			{
				return;
			}

			AddList_.Add(Parameter);
		}

		public void RegistDeleteParameter(AddDeleteParamerter Parameter)
		{
			if (Parameter == null)
			{
				return;
			}

			DeleteList_.Add(Parameter);
		}

		public void RegistModifyParameter(ModifyParameter Parameter)
		{
			if (Parameter == null)
			{
				return;
			}

			ModifyList_.Add(Parameter);
		}
	}
}
